﻿<%@ Page Language="C#" MasterPageFile="~/Frame.Master" AutoEventWireup="true" Codebehind="fmSecurityTrainingList.aspx.cs"
    Inherits="Auto.BusMan.fmSecurityTrainingList" Title="安全培训" %>

<%@ Register Assembly="Auto.WebControls" Namespace="Auto.WebControls" TagPrefix="ComboBox" %>
<%@ Register Src="UserControl/ucDDLKeepDiv.ascx" TagName="ucDDLKeepDiv" TagPrefix="uc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHeader" runat="server">
    <script type="text/javascript">
        var gdv = '<%=GridView1.ClientID%>';
        function ChangeBg() {
            var d;
            var obj = document.getElementById(gdv).getElementsByTagName("tr");
            for (var i = 0; i < obj.length; i++) {
                obj[i].onclick = function () {
                    d = d == "#cccccc" ? "#ffffff" : "#cccccc"; //我不知道你使用的是什么灰色。。
                    this.style.backgroundColor = d;
                }
            }
        }

        if (window.attachEvent)
            window.attachEvent("onload", ChangeBg); 
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentMain" runat="server">
    <div class="TitleDivStyle">
        <asp:Label ID="Label1" runat="server" Text="安全培训"></asp:Label>
    </div>
    <table border="0" cellspacing="1" cellpadding="0">
        <tr>
            <td>
                <div class="OperateStyle">
                 公司：
                    <uc1:ucddlkeepdiv id="ucDDLKeepDiv1" runat="server" />
                    项目:
                    <asp:TextBox ID="txtItem" runat="server"></asp:TextBox>
                    <asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click" CssClass="button_bak" /></div>
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="GridView1" runat="server" CssClass="GridViewStyle" GridLines="Horizontal"
                    AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" Width="678px"
                    DataKeyNames="DocID" CaptionAlign="Left" OnPageIndexChanging="GridView1_PageIndexChanging"
                    OnRowDeleting="GridView1_RowDeleting">
                    <FooterStyle CssClass="GridViewFooterStyle" />
                    <RowStyle CssClass="GridViewRowStyle" />
                    <EditRowStyle CssClass="GridViewEditRowStyle" />
                    <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                    <PagerStyle CssClass="GridViewPagerStyle" />
                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                    <Columns>
                        <asp:BoundField DataField="DocID" HeaderText="序号">
                            <ItemStyle Width="40px" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="项目">
                            <ItemTemplate>
                                <%# Eval("Item")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="培训主要内容">
                            <ItemTemplate>
                                <%# CutString(Eval("TrainingContent"))%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="学习资料">
                            <ItemTemplate>
                                <%# Eval("StudyMaterial")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="执行情况">
                            <ItemTemplate>
                                <%# CutString(Eval("TrainingResult"))%>
                            </ItemTemplate>
                        </asp:TemplateField>
                         <asp:TemplateField HeaderText="查看">
                            <ItemTemplate>
                                <asp:HyperLink ID="hyShow" runat="server" Target="_blank" NavigateUrl='<%# "AddForm/fmSecurityTrainingAddForm.aspx?DocID=" + Eval("DocID") %>'>查看</asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "fmSecurityTrainingManager.aspx?DocID=" + Eval("DocID") %>'>修改</asp:HyperLink>
                                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete" ToolTip="点击删除"
                                    OnClientClick="return confirm('真的要删除吗?');" CommandArgument='<%# Eval("DocID") %>'>删除</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerSettings FirstPageText="First" LastPageText="Last" Mode="NumericFirstLast"
                        NextPageText="Next" PreviousPageText="Previous" />
                    <EmptyDataTemplate>
                        没有数据!
                    </EmptyDataTemplate>
                </asp:GridView>
            </td>
        </tr>
    </table>
</asp:Content>
